import Vue from 'vue'
require("../../API/config")
export default {
    // 登陆
    getlogin({ }, postdata) {
        var ipstr = global.loginPath + '?username=' + postdata.username + '&password=' + postdata.password
        return Vue.http.post(ipstr, JSON.stringify(postdata)).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 新增或更新简历
    gethumanResource({ }, postdata) {
        var ipstr = global.humanResourcePath
        return Vue.http.post(ipstr, JSON.stringify(postdata)).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 发送offer
    getinterviewsendOffer({ }, postdata) {
        var ipstr = global.interviewsendOfferPath
        return Vue.http.post(ipstr, JSON.stringify(postdata)).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 简历反馈
    gethumanResourcesubmitResult({ }, postdata) {
        var ipstr = global.humanResourcesubmitResultPath
        return Vue.http.post(ipstr, JSON.stringify(postdata)).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 删除简历
    gethumanResourceDelete({ }, postdata) {
        var ipstr = global.humanResourcePath + '/' + postdata.id
        return Vue.http.delete(ipstr, {}).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 删除待面试
    getinterviewDelete({ }, postdata) {
        var ipstr = global.interviewPath + '/' + postdata.id
        return Vue.http.delete(ipstr, {}).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 删除入职
    getjoinDelete({ }, postdata) {
        var ipstr = global.joinPath + '/' + postdata.id
        return Vue.http.delete(ipstr, {}).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 简历详情
    getupdate({ }, postdata) {
        var ipstr = global.updatePath + '/' + postdata.id
        return Vue.http.post(ipstr, {}).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 发送邀请
    gethumanResourcesendAppointment({ }, postdata) {
        var ipstr = global.humanResourcesendAppointmentPath
        return Vue.http.post(ipstr, JSON.stringify(postdata)).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 移入黑名单
    gethumanResourcesendmoveToBlack({ }, postdata) {
        var ipstr = global.humanResourcesendmoveToBlackPath + '/' + postdata.id
        if (postdata.remark) {
            return Vue.http.post(ipstr, JSON.stringify({ 'remark': postdata.remark })).then(response => {
                if (response.status === 200) {
                    return Promise.resolve(response.body)
                } else {
                    return Promise.reject(response.data.message)
                }
            })
        } else {
            return Vue.http.post(ipstr, {}).then(response => {
                if (response.status === 200) {
                    return Promise.resolve(response.body)
                } else {
                    return Promise.reject(response.data.message)
                }
            })
        }

    },
    // 黑名单列表
    gethumanResourcepageBlack({ }, postdata) {
        var ipstr = global.humanResourcepagePath + '?pageIndex=' + postdata.pageIndex + '&pageSize=' + postdata.pageSize
        return Vue.http.post(ipstr, {
            items: postdata.items
        }).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 简历列表
    gethumanResourcepage({ }, postdata) {
        var ipstr = global.humanResourcepagePath + '?pageIndex=' + postdata.pageIndex + '&pageSize=' + postdata.pageSize
        return Vue.http.post(ipstr, {}).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 简历列表搜索
    gethumanResourcepageSearch({ }, postdata) {
        var ipstr = global.humanResourcepagePath + '?pageIndex=' + postdata.pageIndex + '&pageSize=' + postdata.pageSize
        return Vue.http.post(ipstr, postdata).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 反馈列表
    getevenpaget({ }, postdata) {
        var ipstr = global.evenpagetPath + '?pageIndex=' + postdata.pageIndex + '&pageSize=' + postdata.pageSize
        return Vue.http.post(ipstr, postdata).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 文件上传
    getuploadFile({ }, postdata) {
        var ipstr = global.uploadFilePath
        return Vue.http.post(ipstr, postdata).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 文件预览
    getuploaddocx2PdfPreviewer({ }, postdata) {
        var ipstr = global.uploaddocx2PdfPreviewerPath + '/' + postdata.name
        return Vue.http.get(ipstr, {}).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 模板上传
    getuploaduploadOfferTemplate({ }, postdata) {
        var ipstr = global.uploaduploadOfferTemplatePath
        return Vue.http.post(ipstr, postdata).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 获取字典
    getdict({ }, postdata) {
        var ipstr = global.dictPath
        return Vue.http.get(ipstr, {}).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response)
            }
        })
    },
    // 新增字典
    getdictAdd({ }, postdata) {
        var ipstr = global.dictPath
        return Vue.http.post(ipstr, postdata).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response)
            }
        })
    },
    // 删除字典
    getdictDelete({ }, postdata) {
        var ipstr = global.dictPath + '/' + postdata.id
        return Vue.http.delete(ipstr, {}).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 添加账号
    getuser({ }, postdata) {
        var ipstr = global.userPath
        return Vue.http.post(ipstr, JSON.stringify(postdata)).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 删除账号
    getuserDelete({ }, postdata) {
        var ipstr = global.userPath + '/' + postdata.id
        return Vue.http.delete(ipstr, {}).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 修改密码
    getuserchangePassword({ }, postdata) {
        var ipstr = global.userchangePasswordPath
        return Vue.http.post(ipstr, JSON.stringify(postdata)).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 面试信息变更
    getinterviewchangeInterviewInfo({ }, postdata) {
        var ipstr = global.interviewchangeInterviewInfoPath
        return Vue.http.post(ipstr, JSON.stringify(postdata)).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 确认入职，更改时间
    getuserchangePassword({ }, postdata) {
        var ipstr = global.joinPath
        return Vue.http.post(ipstr, JSON.stringify(postdata)).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 账号列表
    getuserpage({ }, postdata) {
        var ipstr = global.userpagePath + '?pageIndex=' + postdata.pageIndex + '&pageSize=' + postdata.pageSize
        return Vue.http.post(ipstr, {}).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 账号列表搜索
    getuserpageSearch({ }, postdata) {
        var ipstr = global.userpagePath + '?pageIndex=' + postdata.pageIndex + '&pageSize=' + postdata.pageSize
        return Vue.http.post(ipstr, { items: postdata.items }).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 需求列表列表
    getadvertisesPlanpage({ }, postdata) {
        var ipstr = global.advertisesPlanpagePath + '?pageIndex=' + postdata.pageIndex + '&pageSize=' + postdata.pageSize
        return Vue.http.post(ipstr, {}).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 需求列表列表搜索
    getadvertisesPlanpageSearch({ }, postdata) {
        var ipstr = global.advertisesPlanpagePath + '?pageIndex=' + postdata.pageIndex + '&pageSize=' + postdata.pageSize
        return Vue.http.post(ipstr, postdata).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 新增需求列表
    getadvertisesPlan({ }, postdata) {
        var ipstr = global.advertisesPlanPath
        return Vue.http.post(ipstr, JSON.stringify(postdata)).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 删除需求列表
    getadvertisesPlanDelete({ }, postdata) {
        var ipstr = global.advertisesPlanPath + '/' + postdata.id
        return Vue.http.delete(ipstr, {}).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 预约列表列表
    getinterviewpage({ }, postdata) {
        var ipstr = global.interviewpagePath + '?pageIndex=' + postdata.pageIndex + '&pageSize=' + postdata.pageSize + '&status=' + postdata.status
        return Vue.http.post(ipstr, {}).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 预约列表列表搜索
    getinterviewpageSearch({ }, postdata) {
        var ipstr = global.interviewpagePath + '?pageIndex=' + postdata.pageIndex + '&pageSize=' + postdata.pageSize
        return Vue.http.post(ipstr, { items: postdata.items }).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 待入职列表列表
    getjoinpage({ }, postdata) {
        var ipstr = global.joinpagePath + '?pageIndex=' + postdata.pageIndex + '&pageSize=' + postdata.pageSize
        return Vue.http.post(ipstr, {}).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 待入职列表列表搜索
    getjoinpageSearch({ }, postdata) {
        var ipstr = global.joinpagePath + '?pageIndex=' + postdata.pageIndex + '&pageSize=' + postdata.pageSize
        return Vue.http.post(ipstr, { items: postdata.items }).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 反馈结果
    getinterviewsubmitResult({ }, postdata) {
        var ipstr = global.interviewsubmitResultPath
        return Vue.http.post(ipstr, JSON.stringify(postdata)).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
    // 反馈结果
    getjoinsubmitResult({ }, postdata) {
        var ipstr = global.joinsubmitResultPath
        return Vue.http.post(ipstr, JSON.stringify(postdata)).then(response => {
            if (response.status === 200) {
                return Promise.resolve(response.body)
            } else {
                return Promise.reject(response.data.message)
            }
        })
    },
}
